聘我网

新概念招聘3.0

MATLAB中[1 2]与[1 ,2] 有区别没?

vote up0vote downstar
>> [1 2]

ans =

     1     2

>> [1 ,2]

ans =

     1     2

>> 

从上面看起来貌似没什么区别,是否如此?

 

1 个答复

vote up0vote downcheck

等价。参考此处

The simplest way to create a matrix in MATLAB is to use the matrix constructor operator, []. Create a row in the matrix by entering elements (shown as E below) within the brackets. Separate each element with a comma or space:

row = [E1, E2, ..., Em]          row = [E1 E2 ... Em]
链接

您的回答





不是您要找的问题? 浏览其他含有标签 的问题或者 自己问个.